package logic;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;


public class Creator {

	
	private Integer[][] mat;
	int number;
	public Creator(int n)
	{
		number=1;
		mat=new Integer[n][n];
		for(int i=0;i<n;i++)
		{
		
			for(int j=0;j<n;j++)
			{
				mat[i][j]=new Integer(0);
			}
		}
	}
	
	public Integer[][] getMat() {
		return mat;
	}
	public void setMat(Integer[][] mat) {
		this.mat = mat;
	}
	
	public void addPoints(int xi,int yi, int xf,int yf)
	{
		mat[xi][yi]=number+10;
		mat[xf][yf]=number+20;
		number++;
	}
	
	public void saveInFile(String name) throws IOException
	{
		 FileOutputStream fout = new FileOutputStream(name);
         @SuppressWarnings("resource")
         ObjectOutputStream oos = new ObjectOutputStream(fout);
         oos.writeObject(this.mat);
         oos.close();
	}
}
